package com.youlai.boot.util.mysql;

import cn.hutool.core.util.IdUtil;
import cn.hutool.poi.excel.ExcelReader;
import cn.hutool.poi.excel.ExcelUtil;

import java.util.List;

public class Sql1 {

    public static void main(String[] args) {
        String filePath = "C:\\Users\\Administrator\\Desktop\\项目管理\\数据抓取\\永乐+利居 - 副本.xlsx";
        ExcelReader excelReader = ExcelUtil.getReader(filePath);
        ExcelReader setSheet1 = excelReader.setSheet(0);
        List<List<Object>> sheet1Data = setSheet1.read(1);
        for (List<Object> objects : sheet1Data) {
            Object o = objects.get(4);
            Object o1 = objects.get(5);
            Object o2 = objects.get(25);


            String sql = "INSERT INTO `lps_order`.`lps_wl` (`id`, `no`, `name`, `parent_id`, `sort`, `status`, `remark`, `create_by`, `create_time`, `update_by`, `update_time`, `is_deleted`) VALUES (%s, '%s', '%s', 6, 0, 1, '%s', 1, '2025-07-16 16:53:55', 1, '2025-07-16 16:53:58', 0);\n";
            String format = String.format(sql, IdUtil.getSnowflakeNextId(), o.toString(), o1.toString(), o2.toString());
            System.out.println(format);
        }
    }
}
